package com.example.cjldemo.entity.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;


import javax.validation.constraints.*;
import java.io.Serializable;
/**
 * @author Mr.chi
 * @create 2023/10/31 20:41
 */

@Data
public class UserSaveVo implements Serializable {

    @ApiModelProperty(value = "用户ID")
    private Long id;

    @ApiModelProperty(value = "用户名")
    @NotBlank(message = "用户名不能为空")
    @Size(max = 20,message = "用户名长度不能超过20")
    private String userName;

    @ApiModelProperty(value = "密码")
    @NotBlank(message = "密码不能为空")
    @Size(min = 6,max = 20,message = "密码长度必须在6到20位之间")
    private String password;


    @ApiModelProperty(value = "性别")
    @NotNull(message = "性别非法")
    @Max(value = 2,message = "性别非法")
    @Min(value = 0,message = "性别非法")
    private Integer sex;


    @ApiModelProperty(value = "手机号")
    @Pattern(regexp = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(17[013678])|(18[0,5-9]))\\d{8}$",message = "手机号码不合法")
    private String phone;
}
